package com.dxy.lc.mapper;

import com.dxy.lc.model.entity.Room;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxy.lc.model.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dxy
 * @since 2024-11-07
 */
@Mapper
public interface RoomMapper extends BaseMapper<Room> {

    List<Room> getByUserId(@Param("userId") Integer userId);

    User getPrivateChatUser(@Param("roomId") Integer roomId, @Param("loginUserId") Integer loginUserId);

    Room getPrivateChatRoom(@Param("loginUserId") Integer loginUserId, @Param("toUserId") Integer toUserId);

    List<User> getUsers(@Param("roomId") Integer roomId);
}
